package uc;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

@SuppressLint("Recycle")
public class MaskImageView extends FrameLayout {

	ImageView imageView;

	public MaskImageView(Context context) {
		super(context);
		init();
	}

	public MaskImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public void setScroll(int y) {
		imageView.scrollTo(0, y);
	}

	void init() {
		imageView = new ImageView(getContext());
		imageView.setScaleType(ScaleType.CENTER_CROP);
		this.addView(imageView);
	}

	public void setImage(Bitmap image) {
		imageView.setImageBitmap(image);
	}
}
